package com.th.supcom.pds.impl.manager.impl;

import java.util.List;
import java.util.Map;

import net.carefx.fc.framework.db.manager.GetSequenceHelper;

import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.th.supcom.pds.domain.pojo.PdsPrescDispenseWindow;
import com.th.supcom.pds.domain.pojo.PdsSupplyPro;
import com.th.supcom.pds.impl.dao.PdsSupplyProMapper;
import com.th.supcom.pds.impl.manager.PdsSupplyProManager;

/**
 * PdsSupplyPro 管理接口实现.
 * 
 * 供药过程记录.
 */
public class PdsSupplyProManagerImpl implements PdsSupplyProManager
{
    public static final String TAB_PDS_SUPPLY_PRO = "PDS_SUPPLY_PRO";

    private PdsSupplyProMapper m_pdsSupplyProMapper;

    /** 序列生成器. */
    private GetSequenceHelper m_getSequenceHelper;

    /**
     * 默认的构造函数.
     */
    public PdsSupplyProManagerImpl ()
    {

    }

    /**
     * 获取PdsSupplyProMapper.
     * 
     * @return PdsSupplyProMapper.
     */
    public PdsSupplyProMapper getPdsSupplyProMapper ()
    {
        return m_pdsSupplyProMapper;
    }

    /**
     * 注入PdsSupplyProMapper.
     * 
     * @param pdsSupplyProMapper set pdsSupplyProMapper.
     */
    public void setPdsSupplyProMapper (PdsSupplyProMapper pdsSupplyProMapper)
    {
        m_pdsSupplyProMapper = pdsSupplyProMapper;
    }

    /**
     * 获取序列.
     * 
     * @return GetSequenceHelper
     */
    public GetSequenceHelper getGetSequenceHelper ()
    {
        return m_getSequenceHelper;
    }

    /**
     * 注入序列.
     * 
     * @param getSequenceHelper getSequenceHelper.
     */
    public void setGetSequenceHelper (GetSequenceHelper getSequenceHelper)
    {
        m_getSequenceHelper = getSequenceHelper;
    }

    @Override
    public PdsSupplyPro getPdsSupplyProByID (Long id)
    {
        return m_pdsSupplyProMapper.getPdsSupplyProByID (id);
    }

    @Override
    public Long getPdsSupplyProSeq ()
    {
        return m_getSequenceHelper.getNextSequenceId (TAB_PDS_SUPPLY_PRO);
    }

    @Override
    public List <PdsSupplyPro> findPdsSupplyProListByExample (PdsSupplyPro pdsSupplyPro)
    {
        return m_pdsSupplyProMapper.findPdsSupplyProListByExample (pdsSupplyPro);
    }

    @Override
    public int findPdsSupplyProCountByExample (PdsSupplyPro pdsSupplyPro)
    {
        return m_pdsSupplyProMapper.findPdsSupplyProCountByExample (pdsSupplyPro);
    }

    @Override
    public List <PdsSupplyPro> findPdsSupplyProListByMap (Map <String, Object> params)
    {
        return m_pdsSupplyProMapper.findPdsSupplyProListByMap (params);
    }

    @Override
    public List <PdsSupplyPro> findPdsSupplyProListWithPageByMap (Map <String, Object> params, Integer offset, Integer limit)
    {
        return m_pdsSupplyProMapper.findPdsSupplyProListWithPageByMap (new RowBounds (offset, limit), params);
    }

    @Override
    public Integer findPdsSupplyProCountByMap (Map <String, Object> params)
    {
        return m_pdsSupplyProMapper.findPdsSupplyProCountByMap (params);
    }

    @Override
    public int modifyPdsSupplyPro (PdsSupplyPro pdsSupplyPro)
    {
        return m_pdsSupplyProMapper.modifyPdsSupplyPro (pdsSupplyPro);
    }

    @Override
    public int modifyPdsSupplyProByExample (PdsSupplyPro pdsSupplyPro)
    {
        return m_pdsSupplyProMapper.modifyPdsSupplyProByExample (pdsSupplyPro);
    }

    @Override
    public int modifyPdsSupplyProBySupplyId (PdsSupplyPro pdsSupplyPro)
    {
        return m_pdsSupplyProMapper.modifyPdsSupplyProBySupplyId (pdsSupplyPro);
    }

    @Override
    public int removePdsSupplyProByID (Long id)
    {
        return m_pdsSupplyProMapper.removePdsSupplyProByID (id);
    }

    @Override
    public int removePdsSupplyProByMap (Map <String, Object> params)
    {
        return m_pdsSupplyProMapper.removePdsSupplyProByMap (params);
    }

    @Override
    public Long addPdsSupplyPro (PdsSupplyPro pdsSupplyPro)
    {
        Long id = getPdsSupplyProSeq ();
        pdsSupplyPro.setId (id);
        m_pdsSupplyProMapper.addPdsSupplyPro (pdsSupplyPro);
        return id;
    }

    @Override
    public int modifyPdsSupplyProSortInfoByList (List <PdsSupplyPro> pdsSupplyPros)
    {
        return m_pdsSupplyProMapper.modifyPdsSupplyProSortInfoByList (pdsSupplyPros);
    }

    @Override
    public List <PdsPrescDispenseWindow> findPdsPrescWindowByMap (Map <String, Object> params)
    {
        return m_pdsSupplyProMapper.findPdsPrescWindowByMap (params);
    }

    /** 日志记录器. */
    public static final Logger logger = LoggerFactory.getLogger (PdsSupplyProManagerImpl.class);

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2015, TH Supcom Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";

    @Override
    public void modifyBatchSupplyWindow (Map <String, Object> map)
    {
        m_pdsSupplyProMapper.modifyBatchSupplyWindow (map);
    }

    public List <PdsSupplyPro> findPdsSupplyProListByList (List <PdsSupplyPro> pdsSupplyPros)
    {
        return m_pdsSupplyProMapper.findPdsSupplyProListByList (pdsSupplyPros);
    }
}